<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset="UTF-8">
<title>样式绑定</title>
<script src='./vue.js'></script>
<style>
.activated{
color:red;
}
</style>
</head>
<body>
<div id="app">
     <!-- :class="{activated:isActivated}">-->
	 <!--class activated是否显示取决于isActivated的值-->
	<div @click="handle" 
	     :class="[activated]">
	  hello world</div>
</div>
<script>
var vm=new Vue({
el:"#app",
data:{
//isActivated:false
activated:""
},
methods:{
handle:function(){
//this.isActivated=!this.isActivated;
this.activated=this.activated==="activated"?"":"activated"
}
}

})
</script>
</body>